<template>
	<view>
		<unicloud-db   ref="udb" v-slot:default="{data, loading, error, options}" collection="fengmian">
			<view v-if="error">{{error.message}}</view>
			<view v-else>
			<view  v-for="(item,index) in data ":key="index"  class="car-bigbox " >
					<uni-card @click="getDetail(item)" :to="'/pages/detail/detail?item='+JSON.stringify(item)" >
								<image class="cover-image" mode="aspectFill" :src="item.cover">
								</image>
							<text>{{item.title}}</text>
					</uni-card>
					
			</view>			 
			</view>
		</unicloud-db>
		
	</view>
</template>
<script>
	export default {
			name:'CarDeck',
			data() {
				return {
				
	
				}
			},
			
			methods: {
				onClick(e){
					console.log(e)
				},
				getDetail(item){
						console.log(item);
					let obj=JSON.stringify(item)
					uni.navigateTo({
						url:  '/pages/detail/detail?item='+obj,
					})
				}
				
			}
		}
</script>
<style scoped>
	.car-bigbox{
	 width: 110px;
	  height: 190px;
	 margin-right: 11px;
	 margin-bottom: 20px;
	 float: left;
	  margin-right: 13px;
	  margin-top: 10px;
		
	}
	.box-imgas{
		width: 100%;
	margin-top: 20px;
		
	}
	.car-bigbox .uni-card{
		width: 100%;
		height: 100%;
		
	}
.car-bigbox .uni-card image{
	 width: 100%;
	 height: 160px;
	  background-size: cover;
}
</style>